"use strict";
const obj = {
  get foo() {
    // 如果reflect没设置第三个参数receiver，this指向obj对象
    // 如果reflect设置第三个参数receiver，this指向Proxy
    console.log(this);
    return this.bar;
  },
};

const proxy = new Proxy(obj, {
  get(target, key, receiver) {
    if (key === "bar") {
      return "this is bar";
    }
    return Reflect.get(target, key, receiver);
  },
});

console.log(proxy.foo);
